package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IcPartyMembersMapper;
import com.ruoyi.system.domain.IcPartyMembers;
import com.ruoyi.system.service.IIcPartyMembersService;
import com.ruoyi.common.core.text.Convert;

/**
 * 党员Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class IcPartyMembersServiceImpl implements IIcPartyMembersService 
{
    @Autowired
    private IcPartyMembersMapper icPartyMembersMapper;

    /**
     * 查询党员
     * 
     * @param memberId 党员主键
     * @return 党员
     */
    @Override
    public IcPartyMembers selectIcPartyMembersByMemberId(Long memberId)
    {
        return icPartyMembersMapper.selectIcPartyMembersByMemberId(memberId);
    }

    /**
     * 查询党员列表
     * 
     * @param icPartyMembers 党员
     * @return 党员
     */
    @Override
    public List<IcPartyMembers> selectIcPartyMembersList(IcPartyMembers icPartyMembers)
    {
        return icPartyMembersMapper.selectIcPartyMembersList(icPartyMembers);
    }

    /**
     * 新增党员
     * 
     * @param icPartyMembers 党员
     * @return 结果
     */
    @Override
    public int insertIcPartyMembers(IcPartyMembers icPartyMembers)
    {
        icPartyMembers.setCreateTime(DateUtils.getNowDate());
        return icPartyMembersMapper.insertIcPartyMembers(icPartyMembers);
    }

    /**
     * 修改党员
     * 
     * @param icPartyMembers 党员
     * @return 结果
     */
    @Override
    public int updateIcPartyMembers(IcPartyMembers icPartyMembers)
    {
        icPartyMembers.setUpdateTime(DateUtils.getNowDate());
        return icPartyMembersMapper.updateIcPartyMembers(icPartyMembers);
    }

    /**
     * 批量删除党员
     * 
     * @param memberIds 需要删除的党员主键
     * @return 结果
     */
    @Override
    public int deleteIcPartyMembersByMemberIds(String memberIds)
    {
        return icPartyMembersMapper.deleteIcPartyMembersByMemberIds(Convert.toStrArray(memberIds));
    }

    /**
     * 删除党员信息
     * 
     * @param memberId 党员主键
     * @return 结果
     */
    @Override
    public int deleteIcPartyMembersByMemberId(Long memberId)
    {
        return icPartyMembersMapper.deleteIcPartyMembersByMemberId(memberId);
    }
}
